//
// Created by liushuai on 2020/4/8.
//
#include "Permutation.h"
void Permutation(vector<string>& result,string s,int begin){
    int s_size = s.size();
    if(begin == s_size-1)
        result.push_back(s);
    for(int i=begin;i<s_size;i++){
        swap(s.at(i),s.at(begin));
        Permutation(result,s,begin+1);
        swap(s.at(i),s.at(begin));
    }
}
vector<string> Permutation(string s){
    vector<string> result;
    if(s.size() == 0)
        return result;
    else{
        Permutation(result,s,0);
        return result;
    }
}

